package cn.object.java.com;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Erjinzhi1 {
	public static void main(String[] args) {
		FileInputStream fis=null;
		FileOutputStream fos=null;
		try {
			fos=new FileOutputStream("d:\\b.jpg");
			fis=new FileInputStream("d:\\a.jpg");
			int a=0;
			byte[] gg=new byte[1024];
			while((a=fis.read(gg))!=-1){
				fos.write(gg);
				fos.close();
				fis.close();
			}
				
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	

	}

}

